﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace Krile.Kernel.Bridges
{
    public interface IInputControlManager
    {
        /// <summary>
        /// Set in reply to uid
        /// </summary>
        /// <remarks>
        /// If you set zero to uid,it calls ClearReplyTo() method.
        /// </remarks>
        /// <param name="uid">Message uid</param>
        void SetReplyTo(ulong uid);

        /// <summary>
        /// initialize replying state
        /// </summary>
        void ClearReplyTo();

        /// <summary>
        /// Set service by enforced (replying will be cleared)
        /// </summary>
        /// <param name="svcs">services</param>
        /// <param name="reflectToTabRegister">save to tab</param>
        void SetServices(Data.Service[] svcs, bool saveToTab);

        /// <summary>
        /// Examine current input method's type
        /// </summary>
        /// <param name="type">test type</param>
        /// <returns>equals=true</returns>
        bool CheckCurInputMethodIs(Type type);

        /// <summary>
        /// Get current input method's id.
        /// </summary>
        /// <param name="id">examine id</param>
        /// <remarks>
        /// If I haven't any method now, I always return false.
        /// </remarks>
        bool CheckCurInputMethodIs(string id);

        /// <summary>
        /// Check existing current input method
        /// </summary>
        /// <returns></returns>
        bool IsCurInputMethodExisted();

        /// <summary>
        /// Overwrite input text
        /// </summary>
        /// <param name="text">set text</param>
        void SetInputText(string text);

        /// <summary>
        /// Overwrite input text
        /// </summary>
        /// <param name="text">set text</param>
        /// <param name="raiseInvalidOperationException">if internal input method reference is null, I raise it.</param>
        void SetInputText(string text, bool raiseInvalidOperationException);

        /// <summary>
        /// Get current inputted text
        /// </summary>
        /// <returns></returns>
        string GetInputText();

        /// <summary>
        /// Focus to current input method's text area
        /// </summary>
        void FocusToInput();

        /// <summary>
        /// Set extra data to current input method
        /// </summary>
        /// <remarks>
        /// For security reason, I set this prop only when id matches current method's id.
        /// You should examine current id before call this method.
        /// </remarks>
        /// <param name="id"></param>
        /// <param name="extraData"></param>
        void SetExtraData(string id, object extraData);

        /// <summary>
        /// Append child-form to input method manager.
        /// <para>If you want to use form for helping input, you should this method ALTERNATE IMainForm.AppendChild().</para>
        /// </summary>
        /// <param name="childForm">child form</param>
        void AppendChild(Form childForm);

    }
}
